{extend name="admin/base" /}
{block name="resources"/}
<link rel="stylesheet" type="text/css" href="ADMIN_CSS/product.css">
<style type="text/css">
.fun-a {
	margin-top: 0px;
	padding: 6px 15px 0 15px;
}
.num{width:40px;text-align:center;}	
.cell_total{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:250px;display: block;}
.style0list table input {
	margin-bottom: 0px;
}

.style0list table input.sort {
	width: auto;
	text-align: center;
}

.style0list tbody td {
	line-height: 28px;
}
.cell_total{
	width:120px;
}
</style>
{/block}
{block name="right_tab"}
<li><a class="nscs-table-handle_green" href="{:__URL('ADMIN_MAIN/extend/addaddons')}" ><i class="fa fa-plus-circle"></i>&nbsp;添加插件</a></li>
{/block}
{block name="main"}

<div class="mod-table">
	<div class="con style0list">
			<table>
				 <colgroup>
                    <col style="width: 10%;">
                    <col style="width: 11%;">
                    <col style="width: 25%;">
                    <col style="width: 10%;">
                    <col style="width: 10%;">
                    <col style="width: 10%;">
                    <col style="width: 10%">
                    </colgroup>
				<thead>
					<tr align="center">
                          <th class="x-tab tal"><div class="iconbg-arrow up">名称</div></th>
                          <th class="x-tab tal"><div class="iconbg-arrow up">标识</div></th>
                          <th class="x-tab tal"><div class="iconbg-arrow up">描述</div></th>
                          <th class="x-tab tal"><div class="iconbg-arrow up">状态</div></th>
                          <th class="x-tab tal"><div class="iconbg-arrow up">作者</div></th>
                          <th class="x-tab tal"><div class="iconbg-arrow up">版本</div></th>
					      <th class="x-tab tal">操作</th>
					</tr>
				</thead>
				<colgroup>
                    <col style="width: 10%;">
                    <col style="width: 11%;">
                    <col style="width: 25%;">
                    <col style="width: 10%;">
                    <col style="width: 10%;">
                    <col style="width: 10%;">
                    <col style="width: 10%">
                    </colgroup>
				<tbody>
				</tbody>
			</table>
		</div>
</div>
<input type="hidden" id="id" value="{$id}">
{/block} {block name="script"}

<script type="text/javascript">
//查询用户列表
function LoadingInfo(page_index) {
// 	var search_text = $("#search_text").val();
	$.ajax({
		type : "post",
		url : "{:__URL('ADMIN_MAIN/extend/pluginList')}",
		data : {
			"id" : {$id}
// 			 "page_index" : page_index, "page_size" : $("#showNumber").val(), "search_text" : search_text
		},
		success : function(data) {
			var html = '';
			if (data.length > 0) {
				for (var i = 0; i < data.length; i++) {
					var status = '';
					var operation = '';
					switch(data[i]['status']){
						case -1:
							status = '损坏';
							operation = '';
							break;
						case 0:
							status = '禁用';
							operation = '<a href="'+__URL('ADMIN_MAIN/extend/pluginconfig?addons_id={$id}&plugin_id='+ data[i]['id'])+'">设置</a>&nbsp;<a href="'+__URL('ADMIN_MAIN/extend/enableplugin?addons_id={$id}&plugin_id='+ data[i]['id'])+'">启用</a>&nbsp;<a href="'+__URL('ADMIN_MAIN/extend/uninstallplugin?addons_id={$id}&plugin_id='+ data[i]['id'])+'" >卸载</a>';
							break;
						case 1:
							status = '启用';
							operation = '<a href="'+__URL('ADMIN_MAIN/extend/pluginconfig?addons_id={$id}&plugin_id='+ data[i]['id'])+'">设置</a>&nbsp;<a href="'+__URL('ADMIN_MAIN/extend/disableplugin?addons_id={$id}&plugin_id='+ data[i]['id'])+'">禁用</a>&nbsp;<a href="'+__URL('ADMIN_MAIN/extend/uninstallplugin?addons_id={$id}&plugin_id='+ data[i]['id'])+'" >卸载</a>';
							break;
						case undefined:
							operation = '<a href="'+__URL('ADMIN_MAIN/extend/installplugin?id={$id}&plugin_name='+ data[i]['name'])+'">安装</a>';
							status = '未安装';
							break;
					}
					html += '<tr>';
					html += '<td class="tal">'+ data[i]['title'] +'</td>';
					html += '<td class="tal">'+ data[i]['name'] +'</td>';
					html += '<td class="tal">'+ data[i]['desc'] +'</td>';
					html += '<td class="tal">'+ status +'</td>';
					html += '<td class="tal">'+ data[i]['author'] +'</td>';
					html += '<td class="tal">'+ data[i]['version'] +'</td>';
					html += '<td>'+ operation +'</td>';
					html += '</tr>';
				}
			} else {
				html += '<tr align="center"><th colspan="7">暂无符合条件的数据记录</th></tr>';
			}
			$(".style0list tbody").html(html);
// 			initPageData(data["page_count"],data['data'].length,data['total_count']);
// 			$("#pageNumber").html(pagenumShow(jumpNumber,$("#page_count").val(),{$pageshow}));
		}
	});
}
</script>
{/block}